package com.yjd.bi.jf.service.impl;

import java.util.HashMap;
import java.util.Map;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.yjd.bi.jf.dao.IJfSignDataDao;
import com.yjd.bi.jf.enums.JfIntegralDataIncrEnum;
import com.yjd.bi.jf.enums.JfIntegralDataRefTableEnum;
import com.yjd.bi.jf.enums.JfIntegralDataType;
import com.yjd.bi.jf.model.JfSignDataModel;
import com.yjd.bi.jf.service.IJfIntegralDataService;
import com.yjd.bi.jf.service.IJfSignDataService;
import com.yjd.comm.base.dao.IBaseDao;
import com.yjd.comm.base.service.impl.BaseServiceImpl;
import com.yjd.comm.enums.UserEnums;
import com.yjd.comm.util.DateUtil;
import com.yjd.comm.util.FrameUtil;

/**
 * <b>description</b>：会员积分签到表业务实现<br>
 * <b>time</b>：2017-03-07 15:23:50 <br>
 * <b>author</b>：  ready percy-chen@hotmail.com
 */
@Service("jfSignDataService")
public class JfSignDataServiceImpl extends BaseServiceImpl implements IJfSignDataService {

	/**
	 * 插入
	 * 
	 * @param model
	 * @return
	 * @throws Exception
	 */
	public JfSignDataModel insert(JfSignDataModel model) throws Exception {
		return this.jfSignDataDao.insertModel(model, true);
	}

	/**
	 * 更新
	 * 
	 * @param model
	 * @return
	 * @throws Exception
	 */
	public int update(JfSignDataModel model) throws Exception {
		return this.jfSignDataDao.updateModel(model, true);
	}

	/**
	 * 根据id删除
	 * 
	 * @param id
	 * @return
	 * @throws Exception
	 */
	public int delete(long id) throws Exception {
		Map<Object, Object> paramMap = new HashMap<Object, Object>();
		paramMap.put("id", id);
		return this.jfSignDataDao.deleteModel(paramMap, true);
	}

	/**
	 * 签到
	 * @param user_id
	 * @param time
	 * @throws Exception
     */
	public int sign(Long user_id,Long time,UserEnums.Channel channel) throws Exception {
		
		return 0;
	}


	@Resource
	private IJfSignDataDao jfSignDataDao;
	@Resource
	private IJfIntegralDataService jfIntegralDataService;

	@Override
	public IBaseDao getBaseDao() {
		return this.jfSignDataDao;
	}

}
